| Conditions | 5 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import {Event} from './Event.entity'; |
||
| 43 | |||
| 44 | public calculateNumberOfMealTicket( |
||
| 45 | overview: IEventsOverview, |
||
| 46 | eventsByDate: any[] |
||
| 47 | ): IEventsOverview { |
||
| 48 | for (const sortedEvent of eventsByDate) { |
||
| 49 | let totalPerDay = 0; |
||
| 50 | |||
| 51 | for (const {time, type} of sortedEvent) { |
||
| 52 | if (Event.WORKED_TYPES.includes(type)) { |
||
| 53 | totalPerDay += time; |
||
| 54 | } |
||
| 55 | } |
||
| 56 | |||
| 57 | if (totalPerDay > 0.5) { |
||
| 58 | overview.mealTicket++; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | return overview; |
||
| 63 | } |
||
| 65 |